package com.musifind.adapters;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.musifind.activities.AlbumsFragment;
import com.musifind.activities.ArtistsFragment;
import com.musifind.activities.TracksFragment;

public class TabsPagerAdapter extends FragmentPagerAdapter {

	public TabsPagerAdapter(FragmentManager fm) {
		super(fm);
	}

	@Override
	public Fragment getItem(int index) {

		switch (index) {
		case 0:
			// Tracks fragment activity
			return new TracksFragment();
		case 1:
			// Albums fragment activity
			return new AlbumsFragment();
		case 2:
			// Artists fragment activity
			return new ArtistsFragment();
		}

		return null;
	}

	@Override
	public int getCount() {
		// get item count - number of tabs
		return 3;
	}

}
